//
//  Manager.m
//  oc_23
//
//  Created by 楼楚 on 15/9/17.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import "Manager.h"
static Manager *manager = nil;


@implementation Manager
@synthesize title = _title;
//+ (Manager *) shardeManeger
//{
//    if (manager == nil) {
//        manager = [[[self class]alloc]init];
//           }
//    return manager;
//
//}
//+ (Manager *) shardeManeger
//{
//    @synchronized(self)// 线程加锁 排队执行
//    {
//        
//    
//    if (manager == nil) {
//       manager = [[[self class]alloc]init];
//    }
//    }
//    return manager;
//}

+ (Manager *) shardeManeger
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
            manager = [[[self class]alloc]init];// 只执行一次
        
    });
        return manager;
}

- (id) init
{
    self = [super init];
    if (self) {
        self.title = @"default Title";
    }
    return self;
}


+ (id) copyWithZone:(struct _NSZone *)zone
{
    return  manager;
}
+ (id)allocWithZone:(struct _NSZone *)zone
{
    return manager;
}
@end
